﻿<phone:PhoneApplicationPage 
    x:Class="CalciumTemplateApp.Views.Examples.PersistencyExampleView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c2="clr-namespace:DanielVaughan.Windows;assembly=Calcium.Phone"
    xmlns:l="clr-namespace:CalciumTemplateApp.Controls" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="{Binding AppSettings.SystemTrayVisible, FallbackValue=true}"
    c2:VisualStateUtility.VisualState="{Binding VisualState}"
    Style="{StaticResource PageStyle}">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <l:TitleControl />
        
        <StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <TextBlock TextWrapping="Wrap" Margin="12">
                The following controls are bound to viewmodel properties 
                that are automatically persisted to isolated storage.</TextBlock>
            <TextBlock Text="This text is persisted when the app is closed." 
                           Style="{StaticResource LabelTextStyle}" />
            <TextBox Text="{Binding ExampleText1, Mode=TwoWay}" 
                         VerticalAlignment="Top" />
            <TextBlock Text="This text is only persisted when the app is tombstoned." 
                           Style="{StaticResource LabelTextStyle}" />
            <TextBox Text="{Binding ExampleText2, Mode=TwoWay}" 
                         VerticalAlignment="Top" />
        </StackPanel>
    </Grid>
 
</phone:PhoneApplicationPage>
